def linger(s):
    if len(s) < 2:
        return s
    a = 0
    b = 0
    for i in range(len(s)):
        l1 = e(s, i, i)
        l2 = e(s, i, i + 1)
        c = max(l1, l2)
        if c > b:
            b = c
            a = i - (c - 1) // 2
    return s[a:a + b]


def e(s, left, right):
    while left >= 0 and right < len(s) and s[left] == s[right]:
        left -= 1
        right += 1
    return right - left - 1


s = input("请输入字符串：")
print(linger(s))
